<template>
  <!-- 底部 -->
  <footer class="footer">
    <span class="todo-count"><strong>{{count}}</strong>项任务剩余</span>
    <ul class="filters">
      <li>
        <a :class="{selected:selectedStatus==='#/' || selectedStatus===''}" href="#/">所有</a>
      </li>
      <li>
        <a :class="{selected:selectedStatus==='#/active'}" href="#/active">未完成</a>
      </li>
      <li>
        <a :class="{selected:selectedStatus==='#/completed'}" href="#/completed">已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="removeAll">清除已完成</button>
  </footer>
</template>

<script>
import { mapGetters, mapMutations, mapState } from 'vuex'
export default {
  name: 'TodoFooter',
  data () {
    return {}
  },
  methods: {
    ...mapMutations(['removeAll'])
  },
  computed: {
    ...mapGetters(['count']),
    ...mapState(['selectedStatus'])
  }
}
</script>

<style scoped lang="less">
</style>
